<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>系统构造函数的原型体现</title>
</head>
<body>
    <script>
        let arr = [];    //new Array
        console.log(arr.__proto__ == Array.prototype);
        // 因为Array的实例化对象的原型指向Array的prototype原型，所以Array的prototype原型新增的方法,Array的实例化对象也能用
        Array.prototype.show = function(){
            console.log("我是Array的prototype原型新增的方法");
        };
        arr.show();

        let str = "";   //new String
        console.log(str.__proto__ == String.prototype);

        let number = 1;     //new Number
        console.log(number.__proto__ == Number.prototype);

        let bool = true;    //new Boolean
        console.log(bool.__proto__ == Boolean.prototype);

        let reg = /a/i;   //new RegExp
        console.log(reg.__proto__ == RegExp.prototype);

        let obj = {};   //new Object
        console.log(obj.__proto__ == Object.prototype);
    </script>
</body>
</html>